package cn.javadog.cloud.starter.demo.controller;

import cn.javadog.cloud.starter.demo.domain.UserInfo;
import cn.javadog.cloud.starter.jsonfilter.annotation.JsonFilter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author yuy
 * @date 2020-11-09 16:33
 **/
@RestController
@RequestMapping("/jsonfilter")
public class JsonFilterController {

    @JsonFilter(target = UserInfo.class, fields = {"age"})
    @RequestMapping("/hello")
    public UserInfo hello(){
        UserInfo info = new UserInfo();
        info.setAge(16);
        info.setPassword("123456");
        info.setName("yuy");
        return info;
    }

}
